package homeword.cake;

public class Consumer implements Runnable{
    /**
     * 消费者
     */
    private Repository repository;

    public Consumer(Repository repository) {
        this.repository = repository;
    }


    @Override
    public void run() {
        while (true){
            try {
                this.repository.consumption();
                Thread.yield();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
